using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AudioManager : MonoBehaviour
{
    public static AudioManager instance = null;
    public AudioSource audioSource;
    public List<AudioClip> audioList;
    // Start is called before the first frame update
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
        }
    }
    private void Start()
    {
        audioSource = GetComponent<AudioSource>();
    }
    // Update is called once per frame
    public void PlayShort(AudioClip sound)
    {
        audioSource.PlayOneShot(sound);
    }
    public void PlayShort(int index)
    {
        audioSource.PlayOneShot(audioList[index],2);
    }
}
